
import ApiBoss from "@/api/boss"
import ByIcon from "@/components/ui/ByIcon"
import useFetch from "@/hooks/useFetch"
import { Navigator, Text, View } from "@tarojs/components"

export default () => {


  const { data } = useFetch<{
    report: { report_id: number, report_name: string }[]
  }>(ApiBoss.getAllReport)

  console.log("=!")

  return (
    <View>
      {
        data?.report.map(item => (
          <Navigator className="m-3 flex items-center justify-between bg-white p-4 shadow-black-1 rounded-lg"
            url={`statisticDetail?id=${item.report_id}`}
          >
            <Text>{item.report_name}</Text>
            <ByIcon name="ArrowRight" className="text-primary" />
          </Navigator>
        ))
      }
    </View>
  )
}
